package com.sap.jcp.sm.dto;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;


public class UserTimelineDTO {

	private String currentWeekId;
	private String weekId;
	public String getWeekId() {
		return weekId;
	}

	public void setWeekId(String weekId) {
		this.weekId = weekId;
	}
	private String previousWeekId;
	private String nextWeekId;
	private String currentDate;
	private List<UserTimelineRowDTO> userTimelineRowList;
	
	public List<String> getNextSevenDaysList() {
	
		List<String> weekDays = new ArrayList();
		
		SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
		SimpleDateFormat sdfm = new SimpleDateFormat("dd-MMM-yyyy");
		try {
			Date currentWeekDate = sdf.parse(currentWeekId);
			Calendar calendar = Calendar.getInstance();
			calendar.setTime(currentWeekDate);
			Date nextWeekDate = calendar.getTime();
			weekDays.add(sdfm.format(nextWeekDate));
			for (int index = 0; index < 6 ; index++) {
				calendar.add(Calendar.DATE, 1);
				nextWeekDate = calendar.getTime();
				weekDays.add(sdfm.format(nextWeekDate));
			}
			
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return weekDays;
			
	}
	
	/**
	 * @return the currentWeekId
	 */
	public String getCurrentWeekId() {
		return currentWeekId;
	}
	/**
	 * @param currentWeekId the currentWeekId to set
	 */
	public void setCurrentWeekId(String currentWeekId) {
		this.currentWeekId = currentWeekId;
	}
	/**
	 * @return the previousWeekId
	 */
	public String getPreviousWeekId() {
		return previousWeekId;
	}
	/**
	 * @param previousWeekId the previousWeekId to set
	 */
	public void setPreviousWeekId(String previousWeekId) {
		this.previousWeekId = previousWeekId;
	}
	/**
	 * @return the nextWeekId
	 */
	public String getNextWeekId() {
		return nextWeekId;
	}
	/**
	 * @param nextWeekId the nextWeekId to set
	 */
	public void setNextWeekId(String nextWeekId) {
		this.nextWeekId = nextWeekId;
	}
	/**
	 * @return the currentDate
	 */
	public String getCurrentDate() {
		return currentDate;
	}
	/**
	 * @param currentDate the currentDate to set
	 */
	public void setCurrentDate(String currentDate) {
		this.currentDate = currentDate;
	}
	/**
	 * @return the userTimelineRowList
	 */
	public List<UserTimelineRowDTO> getUserTimelineRowList() {
		return userTimelineRowList;
	}
	/**
	 * @param userTimelineRowList the userTimelineRowList to set
	 */
	public void setUserTimelineRowList(List<UserTimelineRowDTO> userTimelineRowList) {
		this.userTimelineRowList = userTimelineRowList;
	}
	
	
}
